Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

279
Views
Jupyter reports "bad interpreter" following Homebrew Python update

Since updating my Python using Homebrew

jupyter --version

gives

-bash: /usr/local/bin/jupyter: /usr/local/opt/python/bin/python2.7: bad interpreter: No such file or directory

which makes some sense, since there's no longer a Python at /usr/local/.../python2.7. But I don't see any way to repair this.

Prior to updating Python, I there was a Python there, and the Homebrew's symlinked python pointed there, but now which -a python gives

/usr/local/opt/python@2/libexec/bin/python
/usr/local/bin/python
/usr/bin/python

which corresponds to what I want, and are, respectively

  • Homebrew's 2.7, which is found because it is on PATH
  • Homebrew's symlinked 3.6.x
  • Apple's old Python

I've also brew link --overwrite --force python2 for good measure, but this has no effect.

How do I get jupyter to find and use the Python 2.7 on my PATH?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Works for me, its just to link Jupiter with the correct Python version.

 rm '/usr/local/bin/jupyter'
 brew link --overwrite jupyter
 brew link --overwrite --dry-run jupyter
 brew unlink jupyter && brew link jupyter
over 4 years ago · Santiago Trujillo Report

0

Homebrew moved the Python 2 to be keg-only, using the python@2 formula. The jupyter formula has been updated accordingly, please upgrade it:

brew update && brew upgrade jupyter

Note that the Python 2 binary is now only available as python2, the python binary, if installed by Homebrew, is Python 3.

If you installed it with pip, link the Python 2 binary and re-install jupyter using pip2:

brew link -f python@2
/usr/local/bin/pip2 install -U jupyter

You'll end up with a /usr/local/bin/jupyter file that starts with the line #!/usr/local/opt/python@2/bin/python2.7.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!